import numpy as np
import cv2 as cv

# Create a white image
img = np.ones((512,512,3), np.uint8)*255

# rectangle
startPt = (20,20)
endPt   = (round(img.shape[1]/2),round(img.shape[0]/4))
color   = (0,255,0)
thinknessPx = 3
cv.rectangle(img, startPt,endPt, color,thinknessPx)

cv.imshow("img", img)
cv.waitKey(0)
cv.destroyAllWindows()